package training.inner;

public class LocalInnerClass {
	
	private String name="Ambika";
	
	public void sayHello(){
		System.out.println("Hello from LocalInnerClass.sayHello()");
		
		class LocalClass {
			public final String localName ="Hari";
			public void sayHelloFromInner(){
				System.out.println("Hello from sayHelloFromInner.sayHelloFromInner()" + name);
			}
		}
		
		LocalClass local = new LocalClass();
		local.sayHelloFromInner();
		System.out.println(local.localName);
		
	}
	
	public void sayHi(){
		//local inner classes are very much local to the area where it is defined.
		//LocalClass local = new LocalClass();
		//local.sayHelloFromInner();
	}

}
